package cn.bxshey.feign.api;

import cn.bxshey.general.Result.Result;
import cn.bxshey.general.entity.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @作者：不想说话而已
 * @Date：2023/11/28 10:09
 */
@FeignClient(value = "module-orders")
public interface OrderClient extends BaseClient {

    String URL = "/order";
    String PERMISSIONS = URL+"/authentication";

    @GetMapping(URL+"/test")
    Result<String> testDemo();

    @GetMapping(URL+"/selectAll")
    Result<List<Order>> selectAll();

    //根据订单id
    @GetMapping(URL+"/selectById/{id}")
    Order selectById(@PathVariable("id") Long id);

    //根据用户id
    @GetMapping(PERMISSIONS+"/selectByUserId/{id}")
    Result<Order> selectByUserId(@PathVariable("id") Long id);

}
